package ast.statement.ddl

import ast.SqlNode
import ast.expr.SqlExpr
import ast.statement.SqlStatement

/**
 * sql语法树：创建表语句
 * @property name SqlExpr? 创建表名
 * @property columnList MutableList<SqlCreateTableColumn> 字段列表
 */
data class SqlCreateTable(
    var name: SqlExpr? = null,
    val columnList: MutableList<SqlCreateTableColumn> = mutableListOf()
) : SqlStatement

/**
 * sql语法树：创建表的字段
 * @property name SqlExpr? 字段名称
 * @property primary Boolean 是否是主键
 * @property notNull Boolean 是否可空
 * @property dataType String? 数据类型
 * @property default SqlExpr? 默认值
 */
data class SqlCreateTableColumn(
    var name: SqlExpr? = null,
    var primary: Boolean = false,
    var notNull: Boolean = false,
    var dataType: String? = null,
    var default: SqlExpr? = null
) : SqlNode